#ifndef CANSIGNAL_H
#define CANSIGNAL_H

#include <QObject>


class canSignal
{
public:
    canSignal();


private:
    std::string name;
    uint32_t can_id;
    uint32_t start_bit;
    uint32_t bit_length;

    double offset = 0.0;
    double accurancy = 0.0;
    double value = 0.0;
    void assemble_message(unsigned char *data)
    {
        *(uint64_t *)data |= (static_cast<uint64_t>((value - offset) / accurancy)) << start_bit;
    }
};

class SignalFrame
{
public:
    uint32_t id;
    uint32_t period; // 周期
    std::string name;
    std::string frame_type;

    // std::vector<std::shared_ptr<canSignal>> signals;

};

#endif // CANSIGNAL_H
